@echo off

set EXPORT_PATH=".\out\"

set LCM_SU_PATH="server\platform\runtime\lcm\libs\"
set PFCOMMON_SU_PATH="server\platform\common\libs\"
set DEV_SU_PATH="server\platform\dev\main\libs\"


set METADATA_TOOL_PATH="tools\deploy\metadata\runtime\libs\"


for /f "tokens=*" %%i in ('mvn help:evaluate "-Dexpression=project.version" "-DforceStdout=true" -q') do set version=%%i

call mvn clean verify


rmdir /q /s %EXPORT_PATH%



:view-object-api
md %EXPORT_PATH%%DEV_SU_PATH%
copy .\view-object-api\target\view-object-api-%version%.jar %EXPORT_PATH%%DEV_SU_PATH%view-object-api.jar

:view-object-manager
md %EXPORT_PATH%%PFCOMMON_SU_PATH%
md %EXPORT_PATH%%METADATA_TOOL_PATH%
copy .\view-object-manager\target\view-object-manager-%version%.jar %EXPORT_PATH%%PFCOMMON_SU_PATH%com.inspur.edp.formserver.vmmanager.jar
copy .\view-object-manager\target\view-object-manager-%version%.jar %EXPORT_PATH%%METADATA_TOOL_PATH%com.inspur.edp.formserver.vmmanager.jar

:view-object-model
md %EXPORT_PATH%%PFCOMMON_SU_PATH%
md %EXPORT_PATH%%METADATA_TOOL_PATH%
copy .\view-object-model\target\view-object-model-%version%.jar %EXPORT_PATH%%PFCOMMON_SU_PATH%com.inspur.edp.formserver.viewmodel.jar
copy .\view-object-model\target\view-object-model-%version%.jar %EXPORT_PATH%%METADATA_TOOL_PATH%com.inspur.edp.formserver.viewmodel.jar

:view-object-rtwebapi
md %EXPORT_PATH%%LCM_SU_PATH%
copy .\view-object-rtwebapi\target\view-object-rtwebapi-%version%.jar %EXPORT_PATH%%LCM_SU_PATH%formserver-viewmodel-rtwebapi.jar

:view-object-voextendinfo-server-api
md %EXPORT_PATH%%LCM_SU_PATH%
md %EXPORT_PATH%%METADATA_TOOL_PATH%
copy .\view-object-voextendinfo-server-api\target\view-object-voextendinfo-server-api-%version%.jar %EXPORT_PATH%%LCM_SU_PATH%formserver-voextendinfo-server-api.jar
copy .\view-object-voextendinfo-server-api\target\view-object-voextendinfo-server-api-%version%.jar %EXPORT_PATH%%METADATA_TOOL_PATH%formserver-voextendinfo-server-api.jar

:view-object-voextendinfo-server-core
md %EXPORT_PATH%%LCM_SU_PATH%
md %EXPORT_PATH%%METADATA_TOOL_PATH%
copy .\view-object-voextendinfo-server-core\target\view-object-voextendinfo-server-core-%version%.jar %EXPORT_PATH%%LCM_SU_PATH%formserver-voextendinfo-server-core.jar
copy .\view-object-voextendinfo-server-core\target\view-object-voextendinfo-server-core-%version%.jar %EXPORT_PATH%%METADATA_TOOL_PATH%formserver-voextendinfo-server-core.jar

:view-object-webapi
md %EXPORT_PATH%%DEV_SU_PATH%
copy .\view-object-webapi\target\view-object-webapi-%version%.jar %EXPORT_PATH%%DEV_SU_PATH%com.inspur.edp.formserver.viewmodel.webapi.jar

:resource_file
md %EXPORT_PATH%server\platform\common\resources
xcopy /E .\resources  %EXPORT_PATH%server\platform\common\resources
